from flask import Flask
from api.config import Config
from api.routes.data_routes import bp as data_bp
from api.routes.auth_routes import bp as auth_bp
from api.config import Config

def create_app():
    app = Flask(__name__)
    app.config.from_object(Config)
    
    # 注册蓝图
    app.register_blueprint(auth_bp, url_prefix='/api/auth')
    app.register_blueprint(data_bp, url_prefix='/api')
    
    
    return app

if __name__ == '__main__':
    app = create_app()
    app.run(
        host=Config.HOST, 
        port=Config.PORT,
        debug=Config.DEBUG
    )